import deviceInfo from '@ohos.deviceInfo'
import {
  logger
} from '../01-LogManager/Logger_A/log';

export const EnuDeviceModel = "emulator"

export enum DeviceType {
  Phone = "phone",
  Pad = "tablet",
  Pc = "2in1"
}

export class DeviceManager {
  isPhone: boolean = false;
  //是否是模拟器
  isEnu: boolean = false;

  constructor() {
    let deviceType = deviceInfo.deviceType;
    this.isPhone = deviceType == DeviceType.Phone;
    this.isEnu = deviceInfo.productModel == EnuDeviceModel
    logger.info(`[DeviceManager] [isEnu ${this.isEnu}]`);
  }
}

export const deviceManager = new DeviceManager();
